package utils

import (
	"strconv"

	"github.com/gin-gonic/gin"
)

func PageQuery(ctx *gin.Context) map[string]int {
	pageSize, _ := strconv.Atoi(ctx.DefaultQuery("pageSize", "1"))
	pageNum, _ := strconv.Atoi(ctx.DefaultQuery("pageNum", "10"))
	return map[string]int{
		"Offset": (pageSize - 1) * pageNum,
		"Limit":  pageNum,
	}
}
